package com.itheima.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.itheima.mapper.OperateLogMapper;
import com.itheima.pojo.OperateLog;
import com.itheima.pojo.PageBean;
import com.itheima.service.LogService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class LogServiceImpl implements LogService {
    @Resource
    private OperateLogMapper operateLogMapper;

        /**
         * 日志列表查询
         */
        @Override
        public PageBean<OperateLog> operateLog(Integer page, Integer pageSize) {
            PageHelper.startPage(page,pageSize);
            Page<OperateLog> pages = operateLogMapper.page();

            return new PageBean<>((int) pages.getTotal(),pages);
        }
}
